/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Settings;

import java.lang.ProcessBuilder.Redirect.Type;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Tomasz Nowak
 */
public class Settings
{
	Map<String, ISettings> settingsMap;

	public Settings()
	{
		settingsMap = new HashMap<String, ISettings>();
	}

	public void save()
	{
		for ( ISettings setting: settingsMap.values() )
		{
			setting.save();
		}
	}

	public void load()
	{
		for ( ISettings setting: settingsMap.values() )
		{
			setting.load();
		}
	}

	public void register( String className, ISettings settings )
	{
		settingsMap.put(className, settings);
	}

	public Object getSettings( String className )
	{
		return settingsMap.get(className);
	}
}
